<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ page import="com.scalar.chiptrack.users.User,
                 com.scalar.chiptrack.users.UserGroup,
                 com.scalar.chiptrack.commons.SessionKeys"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/jsp/sales/sales.jsp"/>
<%@ page import="com.scalar.chiptrack.utils.ConfigManager"%>
<%@ page import="com.scalar.chiptrack.users.Functionality" %>
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>


<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor="#ffffff" leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<SCRIPT language="JavaScript">

function openRMA(){
        newWindow = window.open('generateRMA.do?action=PrintRMA&rmaId=<%=(String)request.getAttribute("rmaId")%>','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=600,height=600,left=100,top=50,resizable=yes');
  	    newWindow.focus();
    }
function submitPage()
{
    document.generateRmaForm.action.value = "ApproveForm";
    document.generateRmaForm.submit();
}

</SCRIPT>
<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TR>
	<td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

	<%@ include file="/jsp/sales/rma_menu.jsp" %>

<!-- end of the side navigations -->
</TD>

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>

<!-- from here your body starts -->

<html:form name="generateRmaForm" method="post" action="/generateRMA.do" scope="request" type="com.scalar.chiptrack.rma.forms.RMAForm" >
<center><span class="NArialW">RMA Issue Form</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

   <table border="0" width="95%" align=right bordercolor="#FFFFFF">
       	<tr>
       		<td><a name="#e1"></a></td>
       	</tr>
	 	<tr>
	 		<td colspan=6 class="NArialL"><chiptrack:errors styleClass="NArialL" /></td>
	 	</tr>

    	<tr>
    		<td  colspan="6" align="left" class='NArialL'><FONT id="errors1" styleClass="NArialL" color='FF0000'></FONT></td>
    	</tr>

        <tr>
            <td width="21%">&nbsp;</td>
       		<td width="21%">&nbsp;</td>
       		<td width="3%" >&nbsp;</td>
       		<td width="21%">&nbsp;</td>
       		<td width="21%" nowrap>
               <font class="NArialS"><a href="javascript:openRMA();" onMouseOver="window.status='Printer-Friendly Version';return true" onMouseOut="window.status='';return true"><b>[Printer-Friendly Version]</b></a></font>
            </td>
       		<td width="3%" >&nbsp;</td>
        </tr>

        <tr>
            <td width="21%">&nbsp;</td>
       		<td width="21%">&nbsp;</td>
       		<td width="3%" >&nbsp;</td>
       		<td width="21%">&nbsp;</td>
       		<td width="21%">&nbsp;</td>
       		<td width="3%" >&nbsp;</td>
        </tr>

    	<tr>
	   		<td width="21%"><font class="NArialL">RMA Number :</font></td>
       		<td width="10%" class="NArialL"><nested:write name="generateRmaForm" property="rmaNumber" /></td>
       		<td width="3%">&nbsp;</td>
       		<td width="21%"><font class="NArialL">Customer Name :</font></td>
       		<td width="21%" class="bodytext"><b><nested:write name="generateRmaForm" property="customerName" /></b></td>
       		<td width="3%">&nbsp;</td>
    	</tr>

    	<tr>
       		<td width="21%"><font class="NArialL">Requested Date :</font></td>
            <td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="rmaRequestDate" /></td>
        	<td width="3%">&nbsp;</td>
       		<td width="21%"><font class="NArialL">Contact Person :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="contactPerson"  /></td>
       		<td width="3%">&nbsp;</td>
    	</tr>
     	<tr>
       		<td width="21%"><font class="NArialL">Phone :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="phoneNumber" /></td>
       		<td width="3%">&nbsp;</td>
       		<td width="21%"><font class="NArialL">Fax :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="faxNumber" /></td>
	   		<td width="3%">&nbsp;</td>
     	</tr>
     	<tr>
       		<td width="21%"><font class="NArialL">Email :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="email"  /></td>
       		<td width="3%">&nbsp;</td>
       		<td width="21%"><font class="NArialL">RMA Issue date :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="rmaIssueDate"  /></td>
       		<td width="3%">&nbsp;</td>
     	</tr>
        <tr>

       		<td width="21%"><font class="NArialL"><bean:message key="label.sales.endCustomer"/> :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="endUser"  /></td>
       		<td width="3%">&nbsp;</td>
       		<td width="21%"></td>
       		<td width="21%" class="NArialL"></td>
       		<td width="3%">&nbsp;</td>
     	</tr>

     	<tr>
       		<td width="21%"><font class="NArialL">From (Billing Address) :</font></td>
       		<td width="40%">

            <!-- Modified By Basha (02/26/2004) -->
            <table>
            <tr>
                <td><font class="NArialL">Address 1 :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="address1" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">Address 2 :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="address2" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">Address 3 :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="address3" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">Address 4 :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="address4" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">City :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="city" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">State :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="state" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">Zip :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="zipcode" /></td>
            </tr>
            <tr>
                <td><font class="NArialL">Country :</font></td>
                <td class="NArialL">&nbsp;&nbsp;<nested:write name="generateRmaForm" property="country" /></td>
            </tr>
            </table>

       		<html:hidden name="generateRmaForm" property="billingAddressId" />

       		</td>
            <td width="3%">&nbsp;</td>
            <td width="21%"><font class="NArialL">Shipping Address</font></td>
            <td width="21%"><html:textarea rows="6" name="generateRmaForm" property="vendorAddressString" cols="23" styleClass="txfield" disabled="true"/></td>
            <td width="3%">	</td>

            <%--<td width="3%">&nbsp;</td>
       		<td width="21%"><font class="NArialL">Close Date :</font></td>
       		<td width="21%" class="NArialL"><nested:write name="generateRmaForm" property="closeDate"  /></td>
       		<td width="3%">--%>
       		</td>
     	</tr>
     	<tr><td colspan="7" ><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
     	<tr><td colspan="7" >&nbsp;

	   <table border="0" width="98%" bordercolor="#FFFFFF">
	   <tr>
	   	 <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF"> Approve </font></td>

         <td width="8%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">PO Line Item #</font></td>

       	 <td width="20%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">
         <!-- Modified by veeru on (03/17/04)
				Part Number -->
         <bean:message key="label.mfgPartNumber" />
         </font>
         </td>
         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">PO #</font></td>
         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Sales Order #</font></font></td>
         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Invoice #&nbsp;</font></td>
	   	 <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Invoice Date</font></td>
	   	 <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Quantity</font></td>
         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Price</font></td>
         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Extended Price</font></td>

         <!--
	   	 <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Serial#</font></td>
	   	 <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Reason For Failure</font></td>
         -->

	   	 <td width="50%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Problem Description&nbsp;</font></td>
	   	 <td width="50%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Exchange</font></td>
         <td width="50%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Credit</font></td>
         <td width="50%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">FA</font></td>
         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Receive <br> Quantity</font></font></td>

         <td width="50%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Remarks&nbsp;</font></font></td>

         <td width="14%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Close <br> Quantity</font></font></td>

         <td width="50%" align="center" bgcolor="#993333"><font class="NArialL">
	   	 <font color="#FFFFFF">Close Date</font></td>

	   </tr>
       <nested:hidden property="rmaNumber"/>  
       <nested:iterate id="LineItem" property="lineItemList" type="com.scalar.chiptrack.rma.RMALineItem">
	   <tr>
           <nested:hidden property="rmaId"/>
           <nested:hidden property="lineItemNo" />
            <td width="8%" align="center" bgcolor="#DEE1E2">
                <logic:equal name="LineItem" property="isApproved" value="true">
                    <font class="NArialL"><nested:checkbox property="isApproved" disabled="true" styleClass="txfield"/>
                </logic:equal>

                <logic:equal name="LineItem" property="isApproved" value="false">
                <logic:greaterThan name="LineItem" property="quantity" value="0">
                    <font class="NArialL"><nested:checkbox property="isApproved" value="on" styleClass="txfield"/></font>
                </logic:greaterThan>
                </logic:equal>
            </td>
            <td width="8%"  align="left"   bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="poLineItemNo" /></td>
           	<td width="20%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="partNumber" /></td>
            <td width="20%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="poNumber" /></td>
            <td width="20%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="salesOrderNumber" /></td>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="invoiceNumber"  /></td>
           	<td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="invoiceDate"  /></td>
           	<td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="quantity"  /></td>
            <td width="14%" align="right" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="unitPriceAsString"  /></td>
            <td width="14%" align="right" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="extendedPriceAsString"  /></td>
           	<td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="problemDescription" /></td>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL">
          
            <logic:equal  name="LineItem" property="isExchange" value="true">
                Yes
            </logic:equal>
            <logic:equal  name="LineItem" property="isExchange" value="false">
                No
            </logic:equal>
            </td>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL">
            <logic:equal  name="LineItem" property="isCredit" value="true">
                Yes
            </logic:equal>
            <logic:equal  name="LineItem" property="isCredit" value="false">
                No
            </logic:equal>
            </td>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL">
            <logic:equal  name="LineItem" property="isFa" value="true">
                &nbsp;Yes&nbsp;
            </logic:equal>
            <logic:equal  name="LineItem" property="isFa" value="false">
                &nbsp;No&nbsp;
            </logic:equal>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="receiveQty"  /></td>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="remarks" /></td>
            <td width="14%" align="center" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="closeQty"  /></td>
            <td width="14%" align="right" bgcolor="#DEE1E2" class="NArialL"><nested:write name="LineItem" property="lineItemCloseDate"/></td>
            </td>

       </tr>
	   </nested:iterate>


       </table>

       	</td>
     	</tr>


     	<tr><td colspan="6" ><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
     	<tr><td colspan="6" ><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>
        <tr>
	       	<td width="30%">

            </td>

	       	<td width="10%" align="right">
	       	<chiptrack:restrictedLink functionality='<%=com.scalar.chiptrack.users.Functionality.RMA_FORM%>' action='<%=User.USER_ACTION_MODIFY%>' href="javascript:submitPage();" onmouseover="window.status='Click here to save RMA Form';return true" onmouseout="window.status='';return true">
            	<img src="<%=chipTracContext%>/jsp/includes/images/save.gif" title="Click here to Save RMA Form"border='0'></chiptrack:restrictedLink>
            	</td>
	       	<td width="10%"><a href="javascript:document.generateRmaForm.reset();" onmouseover="window.status='Click here to reset RMA Form';return true" onmouseout="window.status='';return true" title="Click here to Reset">
               <img src="<%=chipTracContext%>/jsp/includes/images/reset.gif" border='0'>
               </a></td>
            <td width="10%"></td>
	       	<td width="10%"></td>
	       	<td width="30%">&nbsp;</td>
     	</tr>
   </table>



<input type="hidden" name="action" value="">
</html:form>

<!-- till here -->

<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>
<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->

</BODY>
</HTML>
<%--
<% } catch ( Exception e) { e.printStackTrace(); } %>--%>
